<script>
var bitmap = null;
import fetch from '@/common/fetch.js';
export default {
	 filters: {
		/**
		 * 处理富文本里的图片宽度自适应
		 * 1.去掉img标签里的style、width、height属性
		 * 2.img标签添加style属性：max-width:100%;height:auto
		 * 3.修改所有style里的width属性为max-width:100%
		 * 4.去掉<br/>标签
		 * @param html
		 * @returns {void|string|*}
		 */
		formatRichText(html) {
            if(!html) return
			//控制小程序中图片大小
			let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
				match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
				match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
				match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
				return match;
			});
			newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
				match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi, 'max-width:100%;');
				return match;
			});
			newContent = newContent.replace(/<br[^>]*\/>/gi, '');
			newContent = newContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
			return newContent;
		}
	},
	data: () => ({
		version: 0,
		wget_url: ''
	}),
	methods: {}
};
</script>

<style>
@import 'colorui/main.css';
@import 'colorui/icon.css';
@import 'index.css';
body {
	background-color: #f1f1f1;
	font-size: 13px;
	color: #333;
	font-family: Helvetica Neue, Helvetica, sans-serif;
}
page {
	background-color: #f1f1f1;
	font-size: 13px;
	color: #333;
	font-family: Helvetica Neue, Helvetica, sans-serif;
}
uni-tabbar .uni-tabbar__item:nth-child(4) .uni-tabbar__bd,
wx-tabbar .wx-tabbar__item:nth-child(4) .wx-tabbar__bd {
	background-image: linear-gradient(0deg, #F53D46, #F53D46);
	width: 62px;
	height: 62px;
	border-radius: 50%;
	position: absolute;
	top: -8px;
	box-shadow: 0 0 5px #F53D46;
	box-sizing: border-box;
	border: 1px solid #F53D46;
}

uni-tabbar .uni-tabbar__item:nth-child(4) .uni-tabbar__bd .uni-tabbar__icon__diff,
wx-tabbar .wx-tabbar__item:nth-child(4) .wx-tabbar__bd .wx-tabbar__icon__diff {
	width: 27px;
	height: 44px;
}
uni-modal .uni-modal__hd,
wx-modal .uni-modal__hd {
	padding: 1em 1.6em 0.8em;
	background: #F53D46 !important;
	color: #fff;
}
uni-modal .uni-modal,
wx-modal .wx-modal {
	border-radius: 14px;
}
</style>
